﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnitTesting = Microsoft.VisualStudio.TestTools.UnitTesting;
using MyGDocsAddIn;
using DataType;

namespace TestsRegression.Assert
{
    class Default : State
    {
        public override void ValidateDataState(string UserName, string Password)
        { }

        public override void ValidateUIState()
        {
            MyGDocsForm form = m_Ui.GetUIAccessPoint();
            //check status message
            UnitTesting.Assert.AreEqual(form.StatusMessage.Visible, false);

            //check all buttons state
            //need to use proxy call where collection is involved because ObjectCollection is not serializable
            UnitTesting.Assert.AreEqual(m_Ui.ContactItemsCount(), 0);
            //default root "No items"
            UnitTesting.Assert.AreEqual(m_Ui.TreeNodesCount(), 1);
            //UnitTesting.Assert.AreEqual(form.UserName.Text, "");
            //UnitTesting.Assert.AreEqual(form.Password.Text, "");

            UnitTesting.Assert.AreEqual(form.UserName.Enabled, true);
            UnitTesting.Assert.AreEqual(form.Password.Enabled, true);
            UnitTesting.Assert.AreEqual(form.LoginButton.Visible, true);
            UnitTesting.Assert.AreEqual(form.LoginButton.Enabled, true);
            UnitTesting.Assert.AreEqual(form.ShareButton.Enabled, false);
            UnitTesting.Assert.AreEqual(form.UpdateBtn.Enabled, false);
        }
    }
}
